package day0401;

import java.util.*;
import java.util.stream.Collectors;

public class Number7 {
    /**
     * 1.检查是否存在满足条件的数字组合
     * A = B + 2C
     * <p>
     * 输入
     * 4
     * 2 7 3 0
     * <p>
     * 输出
     * 7 3 2
     * <p>
     * 说明：
     * 7 = 3 + 2 * 2
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        List<Integer> num = Arrays.stream(sc.nextLine().split(" ")).map(Integer::parseInt).collect(Collectors.toList());
        Collections.sort(num);
//        int flag = 0;
        Set<String> result = new HashSet<>();
        for (int i = n - 1; i > 1; i--) {
            for (int j = i - 1; j >= 0; j--) {
                int res = num.get(i) - 2 * num.get(j);
                List<Integer> temp = new ArrayList<>();
                temp.addAll(num);
                temp.remove(num.get(i));
                temp.remove(num.get(j));
                if (temp.contains(res)) {
//                    System.out.println();
                    result.add(num.get(i) + " " + res + " " + num.get(j));
//                    flag = 1;
                }
            }
        }
//        if (flag == 0) {
//            System.out.println(0);
//        }
        if (result.isEmpty()) {
            System.out.println(0);
        } else {
            result.forEach(System.out::println);
        }


    }
}
